<template>
				<div class="nav_header">
					<div class="nav_header_group">
					  <el-tag style="margin: 7px;">欢迎登陆中砼ERP后台管理系统</el-tag>
						 <div class="row memberSet">
							 <div class="nav-img fl" style="text-align:center;line-height:37px">
								 <i class="iconfont icon-zhongtong" style="font-size:28px"></i></div>
							 <el-dropdown trigger="hover" @command="dropdown_click">
								  <h2 class="el-dropdown-link z_gesture">{{userName}}
								  	<i class="el-icon-caret-bottom el-icon--right"></i>
								  </h2>
								  <el-dropdown-menu slot="dropdown">
								    <!-- <el-dropdown-item command="a">个人设置</el-dropdown-item> -->
								    <!-- <el-dropdown-item command="b">我的下属</el-dropdown-item> -->
								    <el-dropdown-item command="c">退出账号</el-dropdown-item>
								  </el-dropdown-menu>
							</el-dropdown>
						 </div>
					</div>
			</div>
</template>

<script>
import {mapGetters,mapActions} from 'vuex'
import {get_Userinfo,get_Token,del_token,set_Userinfo} from '@/utils/auth.js'
export default {
  data() {
    return {
			color : "#3d3d3d",
			companyList:''
		}
	},
	methods:{
		dropdown_click(val){
			switch(val)
			{
				case "a":
				this.$router.push('/set/account')
				break;
				case "b":
				break;
				case "c":
				this.exit();
				break;
			}
		},
		exit(){
			this.$message({
				type: 'success',
				message: '退出成功!'
			})
			del_token("sys_token");
			window.location = "#/login";
		}
	},
	computed:mapGetters([
		'userName'
	]),
	created(){
		console.log(get_Userinfo());
	},
	mounted(){
	}
}
</script>
<style scoped lang="scss">
	@import "./nav-header.scss";
</style>
